Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JEventProcessorPODIO: deprecate podio:output_include_collections parameter #1466

Merged
merged 4 commits into from
Jun 3, 2024

Conversation

veprbl
Copy link
Member

@veprbl veprbl commented May 20, 2024

This is a follow up on a resolution from #1323

What kind of change does this PR introduce?

  • Bug fix (issue #__)
  • New feature (issue #__)
  • Documentation update
  • Other: __

Please check if this PR fulfills the following:

  • Tests for the changes have been added
  • Documentation has been added / updated
  • Changes have been communicated to collaborators

Does this PR introduce breaking changes? What changes might users need to make to their code?

No

Does this PR change default behavior?

No

@veprbl veprbl temporarily deployed to github-pages May 21, 2024 05:48 — with GitHub Actions Inactive
@veprbl veprbl added this to the 24.06.0 milestone May 21, 2024
@veprbl veprbl temporarily deployed to github-pages May 22, 2024 00:04 — with GitHub Actions Inactive
@wdconinc
Copy link
Contributor

Been experimenting with automated code review. This is what chatgpt gives.

Here is a review of the provided patch:

General Overview

The patch deprecates the podio:output_include_collections parameter in favor of podio:output_collections and makes related code adjustments. It also includes some changes for "Include What You Use" (IWYU) compliance.

Detailed Review

1. Deprecation of podio:output_include_collections

Changes Made:

  • Introduced a new parameter podio:output_collections.
  • Added logic to handle the deprecated podio:output_include_collections parameter, which clears output_collections if the deprecated parameter is used.
  • Modified logging and processing functions to handle the new parameter.
  • Added warnings and delays if the deprecated parameter is used.

Code Review:

  • Consistency: The parameter deprecation is handled consistently throughout the code.
  • Backward Compatibility: The code provides backward compatibility with a clear deprecation warning and a delay, ensuring users notice the change.
  • Logging: The error logging for the deprecated parameter is helpful but using m_log->warn instead of m_log->error might be more appropriate since it's not an error in the system but a usage warning.

2. Include What You Use (IWYU) Adjustments

Changes Made:

  • Adjusted the order of includes for IWYU compliance.
  • Added an entry to .github/iwyu.imp to correctly map <bits/chrono.h> to <chrono>.
  • Removed unnecessary IWYU pragma comments.

Code Review:

  • Correctness: The adjustments seem correct and improve the compliance with IWYU guidelines.
  • Maintenance: These changes improve maintainability by ensuring only necessary headers are included.

Suggested Improvements

  1. Warning Level: Change the log level for deprecation warning to warn:
    m_log->warn("The podio:output_include_collections was provided, but is deprecated. Use podio:output_collections instead.");
  2. Code Comments: Add comments explaining why the delay is introduced when the deprecated parameter is used. This will help future maintainers understand the reasoning behind this decision.

Summary

Overall, the patch is well-constructed, handling the deprecation gracefully while maintaining backward compatibility. The IWYU changes are appropriate and follow best practices. Only minor adjustments regarding logging levels and additional comments are recommended.

Example Modified Section

if (m_output_include_collections_set) {
    m_log->warn("The podio:output_include_collections was provided, but is deprecated. Use podio:output_collections instead.");
    // Adding a delay to ensure users notice the deprecation warning.
    using namespace std::chrono_literals;
    std::this_thread::sleep_for(10s);
}

Great job on the patch!

@veprbl
Copy link
Member Author

veprbl commented Jun 3, 2024

@wdconinc Ready to approve?

Copy link
Contributor

@wdconinc wdconinc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@wdconinc wdconinc enabled auto-merge June 3, 2024 18:07
@wdconinc wdconinc added this pull request to the merge queue Jun 3, 2024
Merged via the queue into main with commit 45cfa7e Jun 3, 2024
83 of 84 checks passed
@wdconinc wdconinc deleted the pr/deprecate_output_include_collections branch June 3, 2024 22:15
@veprbl veprbl temporarily deployed to github-pages June 3, 2024 22:15 — with GitHub Actions Inactive
github-merge-queue bot pushed a commit that referenced this pull request Aug 17, 2024
…tput_include_collections (#1578)

### Briefly, what does this PR introduce?

This is a follow up on #1466 with focus on docs and use examples in
general.

### What kind of change does this PR introduce?
- [x] Bug fix (issue #__)
- [ ] New feature (issue #__)
- [ ] Documentation update
- [ ] Other: __

### Please check if this PR fulfills the following:
- [ ] Tests for the changes have been added
- [ ] Documentation has been added / updated
- [ ] Changes have been communicated to collaborators

### Does this PR introduce breaking changes? What changes might users
need to make to their code?
No

### Does this PR change default behavior?
No
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants